#include <QtGui/QApplication>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;

    QSqlDatabase db =QSqlDatabase::addDatabase("QSQLITE");

db.setDatabaseName("mydatabase.sqlite");
QSqlTableModel model;
model.setTable("Name");
model.setHeaderData(0, Qt::Horizontal, "imya");
model.setHeaderData(1, Qt::Horizontal, "familiya");
model.setHeaderData(2, Qt::Horizontal, "gruppa");
model.select();

QSqlTableModel model2;
model2.setTable("fac");
model2.setHeaderData(0, Qt::Vertical, "Facultet");
model2.select();

QSqlTableModel model3;
model3.setTable("gruppa");
model3.setHeaderData(0, Qt::Vertical, "gruppa");
model3.select();

w.lay.addWidget(&w.table);
w.lay.addWidget(&w.table2);
w.lay.addWidget(&w.table3);

w.table.setModel(&model);

w.table2.setModel(&model2);

w.table3.setModel(&model3);

w.wid.setLayout(&w.lay);
w.setCentralWidget(&w.wid);

    w.show();
    
    return a.exec();
}
